const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const mongoosePaginate = require('mongoose-paginate');
const ObjectId = Schema.ObjectId;


//设置新闻 标题 title、内容 content、tree的ID、及当前日期
var NewsSchema = new mongoose.Schema({
    title:String,
    content:String,
    cateId:String,
    date:{type:Date,default: Date.now },
});
// 将数据模型应用分页插件
NewsSchema.plugin(mongoosePaginate);

module.exports = mongoose.model('News', NewsSchema,'news');